/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package openfireconnection.group.model;

/**
 *
 * @author Miguel y Juanan - Telecor
 */
public class MemberModel {
    private String memberName;
    private String administrator;
    private String groupName;

    @Override
    public boolean equals(Object memberModel) {
        if(memberModel == null) {
            return false;
        } else {
            if(memberModel instanceof MemberModel) {
                if(memberName.equals(((MemberModel)memberModel).getMemberName())
                        && ((MemberModel)memberModel).getAdministrator().equals(administrator)
                        && ((MemberModel)memberModel).getGroupName().equals(groupName)) {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        }
    }
    
    @Override
    public int hashCode() {
        int result = 17;
        result *= 31 * memberName.hashCode();
        result *= 31 * administrator.hashCode();
        result *= 31 * groupName.hashCode();
        return result;
    }
    
    public MemberModel(String memberName) {
        this.memberName = memberName;
    }
    
    public MemberModel() {
        
    }
    
    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getAdministrator() {
        return administrator;
    }

    public void setAdministrator(String administrator) {
        this.administrator = administrator;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }
}
